﻿package  {
	
	import flash.display.MovieClip;
	import flash.events.*
	import FileOpenHelper;
	
	public class ConverterMain extends MovieClip {
		
		private var openFile:FileOpenHelper;
		
		public function ConverterMain() {
			// constructor code
			openFile = new FileOpenHelper();
			open_button.addEventListener(MouseEvent.CLICK, onOpenClick);
		}
		
		private function onOpenClick(event:MouseEvent):void {
			openFile.startLoad();
			openFile.addEventListener(Event.INIT, onFileLoad);
		}
		
		private function onFileLoad(event:Event):void {
			var xml:XML = new XML(openFile.getData());
			leftTF.text = openFile.getData();
			rightTF.text = TemplateAS3.buildConstFile(xml);
		}
	}
	
}
